package homework1;

public class GongChang {
    public static person getPerson(String sex){
        if(sex.equalsIgnoreCase("M"))
        {
            return new Man();
        }
        if (sex.equalsIgnoreCase("W")){
            return new Woman();
        }
        if (sex.equalsIgnoreCase("R"))
        {
            return new Robot();
        }else {
            return null;
        }
    }
}